<%--
  document: home.jsp
  
  description:
    This is the main Web site page.
 --%>

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%-- Importations --%>
<%@page import="javax.el.*" %>
<%@page import="javax.naming.*" %>
<%@page import="javax.transaction.*" %>
<%@page import="javax.faces.context.*" %>
<%@page import="com.reimscopie.*" %>
<%@page import="com.reimscopie.beans.interfaces.* "%>


<%-- Tag libs --%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="core"%> 
<%@taglib uri="http://java.sun.com/jsf/html" prefix="html"%> 

<%-- Controlers --%>
<%@include  file="jspf/controlers.jspf" %>

<%-- i18n --%>
<%
  if (request.getParameter("language") != null)
    userControler.setLanguage(request.getParameter("language")) ;
%>
<%@include file="jspf/i18n/i18n.jspf" %>


<%
    Context context = new InitialContext() ;
    String name ="com.reimscopie.beans.session.ReimsCopieUserBean_" +
    ReimsCopieUserLocal.class.getName()+"@Local" ;    
    ReimsCopieUserLocal bean = (ReimsCopieUserLocal)context.lookup(name) ;   
    
    String transactionName = "javax.transaction.UserTransaction" ;
    UserTransaction transaction =
            (UserTransaction)context.lookup(transactionName);
    transaction.begin() ;
    
    BonPlan bestPlan = bean.getBestBonPlan() ;
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
          "http://www.w3.org/TR/html4/loose.dtd">

<html>
	<head>
    <%@ include file = "jspf/header.jspf" %>
	</head>
  
  <body>


<core:view>
  
  <div id="page">
    
  <%@include file = "jspf/top.jspf" %>
  
  <div id="middle">
    <div id="menu">
      <div id="search">
        <%@ include file = "jspf/search.jspf" %>
      </div>
      <div id="menu_task">
        <%@ include file = "jspf/home/menu.jspf" %>
      </div>
    </div>
    <div id="contents">
      <div id="onglet">
        <%! String activeTab = "home"; %>
        <%@ include file = "jspf/onglet.jspf" %>
      </div>
      
      <%-- Tree Menu --%>
      <div id="tree">
        &gt;&gt; <a href="home.jsf"><%= i18nBundle.getString("home") %></a>
      </div>
      
      <%-- Languages flags --%>
      <div  id="in" style="height: 1500px">
        <table align="center">
          <tr>
            <td>
              <a href="home.jsf?language=fr">
                <img alt="fr" src="images/flag-fr.gif" style="border: none"/>
              </a>
            </td>
            <td>
              <a href="home.jsf?language=en">
                <img alt="en" src="images/flag-en.gif" style="border: none"/>
              </a>
            </td>
          </tr>
        </table>     
      
      	<%-- Page content --%>
        <%@ include file = "jspf/home/contents.jspf" %>
      </div>
      
    </div>
  </div>
  
  <div id="page_end">
    <%@ include file = "jspf/page-end.jspf" %>
  </div>
  
</core:view>

<%@include file="jspf/footer.jspf" %>
  
<%
    transaction.commit();    
%>
